﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PI_CS_Tools;

namespace  PI_CS_Library.Virtual_Network_Information_Model
{
    public class Link
    {
        protected Identification _id;

        Matrix _srcMatrix;
        Matrix _sinkMatrix;

        protected LinkParameters _parameters;

        protected Dictionary<int, LinkConnection> _linkConnectionsList;

        public Link(Matrix _srcMatrix, Matrix _sinkMatrix, LinkParameters _parameters)
        {
            this._srcMatrix = _srcMatrix;
            this._sinkMatrix = _sinkMatrix;

            _linkConnectionsList = new Dictionary<int, LinkConnection>();
            this._parameters = _parameters;

            _id = new Identification("Link: From: "+ _srcMatrix + " To: " +_sinkMatrix);
        }

        public Link(LinkParameters _parameters)
        {
            this._parameters = new LinkParameters(_parameters);

            _linkConnectionsList = new Dictionary<int, LinkConnection>();
            _id = new Identification("Link: From: " + _srcMatrix + " To: " + _sinkMatrix);
        }

        public Link(int _capacity)
        {
            this._parameters = new LinkParameters(_capacity);

            _linkConnectionsList = new Dictionary<int, LinkConnection>();
            _id = new Identification("Link: From: " + _srcMatrix + " To: " + _sinkMatrix);
        }

        public Identification Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public LinkParameters Parameters
        {
            get { return _parameters; }
            set { _parameters = value; }
        }

        public Matrix SrcMatrix
        {
            get { return _srcMatrix; }
            set { _srcMatrix = value; }
        }

        public Matrix SinkMatrix
        {
            get { return _sinkMatrix; }
            set { _sinkMatrix = value; }
        }

        public Dictionary<int, LinkConnection> LinkConnectionsList
        {
            get { return _linkConnectionsList; }
            set { _linkConnectionsList = value; }
        }

        public override string ToString()
        {
            return _id.ToString();
        }
    }

}
